#include <fcntl.h>
#include <sys/types.h>
#include <stdio.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <unistd.h>

int main() {
	int fd;
	if(-1 == (fd = open("/tmp/hello.c" , O_CREAT | O_TRUNC | O_WRONLY, 0600))) {
		perror("open");
		exit(1);
	} else {
		printf("open file:hello.c %d\n", fd);
	}

	if(close(fd) < 0) {
		perror("close");
		exit(1);
	} else {
		printf("Close hello.c\n");
	}

	exit(0);
}
